import 'dart:convert';

class JsonUtil {
  static String unzipJson(Map<String, dynamic> map) {
    return const JsonEncoder.withIndent('  ').convert(map);
  }

  static String zipJson(String s) {
    return jsonEncode(jsonDecode(s));
  }

  static String format(String value) {
    return unzipJson(jsonDecode(value
        .replaceAll("“", "\"")
        .replaceAll("”", "\"")
        .replaceAll("‘", "\"")
        .replaceAll("’", "\"")
        .replaceAll("'", "\"")
        .replaceAll("：", ":")
        .replaceAll("，", ",")));
  }
}
